import 'package:flutter/material.dart';
import 'package:ost_flutter_module/class/entity/store/store_search_entity.dart';
import 'package:ost_flutter_module/common/utils.dart';
import 'package:ost_flutter_module/help/ost_route.dart';
import 'widgets/store_course_home_card.dart';

class StoreCourseHomeListPage extends StatelessWidget {
  final int type;
  final List<StoreSearchEntityShiftList> entitys;
  const StoreCourseHomeListPage({Key key, this.type, this.entitys})
      : super(key: key);

  @override
  Widget build(BuildContext context) {
    return ListView.builder(
      itemCount: entitys.length,
      shrinkWrap: true,
      physics: NeverScrollableScrollPhysics(),
      itemBuilder: (context, index) {
        return StoreCourseHomeCard(
          type: CourseCardType.values[type],
          shift: StoreSearchEntityShiftList(),
          onTap: (_) {
            Navigator.pushNamed(context, GRouter.course_detial_page);
          },
        );
      },
    );
  }
}
